package gewu.suleju.util;

import gewu.suleju.model.vo.HouseInforAll;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class ListForOverlapUtil {
    public List<HouseInforAll> getOverlap(List<HouseInforAll> oneList, List<HouseInforAll> twoList) {
        List<HouseInforAll> threeList = new ArrayList<>();
        for(HouseInforAll one : oneList) {
            for(HouseInforAll two : twoList) {
                if(one.getId() == two.getId()){
                    threeList.add(one);
                }
            }
        }
        return threeList;
    }
}
